package com.xxxx.server.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.xxxx.server.pojo.Admin;
import com.xxxx.server.pojo.RespBean;
import com.xxxx.server.pojo.Role;
import org.springframework.security.core.userdetails.UserDetailsService;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * <p>
 * 服务类
 * </p>
 *
 * @author zhoubin
 * @since 2021-04-27
 */
public interface IAdminService extends IService<Admin> {
    /**
     * 登录之后返回token
     */

    RespBean login(String username, String password, String code, HttpServletRequest request);

    /*
     * 根据用户名获取用户
     * */
    Admin getAdminByUserName(String username);

    /**
     * 根据用户id查询角色列表
     *
     * @param adminId
     * @return
     */
    List<Role> getRoles(Integer adminId);

    /*
     * 获取所有操作员
     * */
    List<Admin> getAllAdmins(String keywords);

    /*
     * 更新操作员角色
     * */
    RespBean addAdminRole(Integer adminId, Integer[] rids);

    /*
   更新用户密码
    */
    RespBean updateAdminPassword(String oldPass, String pass, Integer adminId);

}
